/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package bean;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author Jennerson
 */
@Entity
@Table(name="Curso")
public class Curso {	
    
    @Id
    private int codCurso;
	
    @Column(length=100)
    private String nome;
	
    @Column(length=100)
    private int carga_horaria;
    
    @OneToMany(mappedBy = "curso")
    private List<Disciplina> disciplinas;
    
    public int getCodCurso() {
        return codCurso;
    }

    public void setCodCurso(int codCurso) {
        this.codCurso = codCurso;
    }

    public String getNome() {
        return nome;
    }

    public void setNome(String nome) {
        this.nome = nome;
    }

    public int getCarga_horaria() {
        return carga_horaria;
    }

    public void setCarga_horaria(int carga_horaria) {
        this.carga_horaria = carga_horaria;
    }
    
    public List<Disciplina> getDisciplinas() {
		return disciplinas;
	}

	public void setDisciplinas(List<Disciplina> disciplinas) {
		this.disciplinas = disciplinas;
	}

	@Override
	public boolean equals(Object obj) {
		if(obj instanceof Curso){
			Curso c = (Curso) obj;
			if(c.getCodCurso() == this.getCodCurso()){
				return true;
			}
		}
		return false;
	}     
        
}        

